package com.zhonghui.modlules.user.eshopDomain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

@TableName("system_city")
public class SystemCity implements Serializable {
    @TableId
    private Integer id;
    @NotNull
    @JsonProperty("city_id")
    private Integer cityId;
    @NotNull
    private Integer level;
    @NotNull
    private Integer parentId;
    @NotBlank
    private String areaCode;
    @NotBlank
    private String name;
    @NotBlank
    private String mergerName;
    @NotBlank
    private String lng;
    @NotBlank
    private String lat;
    @NotNull
    private Integer isShow;
    @TableField(
            exist = false
    )
    private List<SystemCity> children;

    public void copy(SystemCity source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }

    public SystemCity() {
    }

    public Integer getId() {
        return this.id;
    }

    public Integer getCityId() {
        return this.cityId;
    }

    public Integer getLevel() {
        return this.level;
    }

    public Integer getParentId() {
        return this.parentId;
    }

    public String getAreaCode() {
        return this.areaCode;
    }

    public String getName() {
        return this.name;
    }

    public String getMergerName() {
        return this.mergerName;
    }

    public String getLng() {
        return this.lng;
    }

    public String getLat() {
        return this.lat;
    }

    public Integer getIsShow() {
        return this.isShow;
    }

    public List<SystemCity> getChildren() {
        return this.children;
    }

    public void setId(final Integer id) {
        this.id = id;
    }

    @JsonProperty("city_id")
    public void setCityId(final Integer cityId) {
        this.cityId = cityId;
    }

    public void setLevel(final Integer level) {
        this.level = level;
    }

    public void setParentId(final Integer parentId) {
        this.parentId = parentId;
    }

    public void setAreaCode(final String areaCode) {
        this.areaCode = areaCode;
    }

    public void setName(final String name) {
        this.name = name;
    }

    public void setMergerName(final String mergerName) {
        this.mergerName = mergerName;
    }

    public void setLng(final String lng) {
        this.lng = lng;
    }

    public void setLat(final String lat) {
        this.lat = lat;
    }

    public void setIsShow(final Integer isShow) {
        this.isShow = isShow;
    }

    public void setChildren(final List<SystemCity> children) {
        this.children = children;
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof SystemCity)) {
            return false;
        } else {
            SystemCity other = (SystemCity)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                label143: {
                    Object this$id = this.getId();
                    Object other$id = other.getId();
                    if (this$id == null) {
                        if (other$id == null) {
                            break label143;
                        }
                    } else if (this$id.equals(other$id)) {
                        break label143;
                    }

                    return false;
                }

                Object this$cityId = this.getCityId();
                Object other$cityId = other.getCityId();
                if (this$cityId == null) {
                    if (other$cityId != null) {
                        return false;
                    }
                } else if (!this$cityId.equals(other$cityId)) {
                    return false;
                }

                Object this$level = this.getLevel();
                Object other$level = other.getLevel();
                if (this$level == null) {
                    if (other$level != null) {
                        return false;
                    }
                } else if (!this$level.equals(other$level)) {
                    return false;
                }

                label122: {
                    Object this$parentId = this.getParentId();
                    Object other$parentId = other.getParentId();
                    if (this$parentId == null) {
                        if (other$parentId == null) {
                            break label122;
                        }
                    } else if (this$parentId.equals(other$parentId)) {
                        break label122;
                    }

                    return false;
                }

                label115: {
                    Object this$isShow = this.getIsShow();
                    Object other$isShow = other.getIsShow();
                    if (this$isShow == null) {
                        if (other$isShow == null) {
                            break label115;
                        }
                    } else if (this$isShow.equals(other$isShow)) {
                        break label115;
                    }

                    return false;
                }

                Object this$areaCode = this.getAreaCode();
                Object other$areaCode = other.getAreaCode();
                if (this$areaCode == null) {
                    if (other$areaCode != null) {
                        return false;
                    }
                } else if (!this$areaCode.equals(other$areaCode)) {
                    return false;
                }

                Object this$name = this.getName();
                Object other$name = other.getName();
                if (this$name == null) {
                    if (other$name != null) {
                        return false;
                    }
                } else if (!this$name.equals(other$name)) {
                    return false;
                }

                label94: {
                    Object this$mergerName = this.getMergerName();
                    Object other$mergerName = other.getMergerName();
                    if (this$mergerName == null) {
                        if (other$mergerName == null) {
                            break label94;
                        }
                    } else if (this$mergerName.equals(other$mergerName)) {
                        break label94;
                    }

                    return false;
                }

                label87: {
                    Object this$lng = this.getLng();
                    Object other$lng = other.getLng();
                    if (this$lng == null) {
                        if (other$lng == null) {
                            break label87;
                        }
                    } else if (this$lng.equals(other$lng)) {
                        break label87;
                    }

                    return false;
                }

                Object this$lat = this.getLat();
                Object other$lat = other.getLat();
                if (this$lat == null) {
                    if (other$lat != null) {
                        return false;
                    }
                } else if (!this$lat.equals(other$lat)) {
                    return false;
                }

                Object this$children = this.getChildren();
                Object other$children = other.getChildren();
                if (this$children == null) {
                    if (other$children != null) {
                        return false;
                    }
                } else if (!this$children.equals(other$children)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof SystemCity;
    }

    public int hashCode() {
        boolean PRIME = true;
        int result = 1;
        Object $id = this.getId();
        result = result * 59 + ($id == null ? 43 : $id.hashCode());
        Object $cityId = this.getCityId();
        result = result * 59 + ($cityId == null ? 43 : $cityId.hashCode());
        Object $level = this.getLevel();
        result = result * 59 + ($level == null ? 43 : $level.hashCode());
        Object $parentId = this.getParentId();
        result = result * 59 + ($parentId == null ? 43 : $parentId.hashCode());
        Object $isShow = this.getIsShow();
        result = result * 59 + ($isShow == null ? 43 : $isShow.hashCode());
        Object $areaCode = this.getAreaCode();
        result = result * 59 + ($areaCode == null ? 43 : $areaCode.hashCode());
        Object $name = this.getName();
        result = result * 59 + ($name == null ? 43 : $name.hashCode());
        Object $mergerName = this.getMergerName();
        result = result * 59 + ($mergerName == null ? 43 : $mergerName.hashCode());
        Object $lng = this.getLng();
        result = result * 59 + ($lng == null ? 43 : $lng.hashCode());
        Object $lat = this.getLat();
        result = result * 59 + ($lat == null ? 43 : $lat.hashCode());
        Object $children = this.getChildren();
        result = result * 59 + ($children == null ? 43 : $children.hashCode());
        return result;
    }

    public String toString() {
        return "SystemCity(id=" + this.getId() + ", cityId=" + this.getCityId() + ", level=" + this.getLevel() + ", parentId=" + this.getParentId() + ", areaCode=" + this.getAreaCode() + ", name=" + this.getName() + ", mergerName=" + this.getMergerName() + ", lng=" + this.getLng() + ", lat=" + this.getLat() + ", isShow=" + this.getIsShow() + ", children=" + this.getChildren() + ")";
    }
}
